import * as types from './action-types'
export default {
  increment(){
    return {type: types.INCREMENT}
  }
  ,asyncIncrement(){
    // 当调用此方法的时候会向仓库派发一个异步加1(ASYNC_INCREMENT)的动作
    // 这个ASYNC_INCREMENT动作是派发了watcherSaga(监听saga)
    //rootSaga是饭店的入口 watchSaga就是服务员 workerSaga厨师
    return {type:types.ASYNC_INCREMENT}
  }
  ,login(username: string,password: string){
    return {type: types.LOGIN_REQUEST, username, password};
  }
  ,logout(){
    return {type: types.LOGOUT_REQUEST};
  }
  ,stop(){
    return {type: types.STOP}
  }
}
